#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int arr[10005];
int main()
{
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &arr[i]);
        if (i > 0) {
            if ((arr[i] ^ arr[i - 1]) == 0) {
                arr[i] = -101;
                arr[i - 1] = -101;
                n -= 2;
                i -= 2;
            }
        }
    }
    if (arr[0] == -101) {
        printf("NULL");
        return 0;
    }
    for (int i = 0; i < n; i++) {
        printf("%d ", arr[i]);
    }
    return 0;
}